'''
----------------------------------------------------------------------------------------------------------------------------------
f = open ("my_diary.txt","a",encoding="utf-8")
a = input("请输入今天的日期")
f.write(f"{a}\n")
b = input("请输入今日总结")
f.write(f"{b}\n")
f.write("今日以追加\n")
f.flush()
f = open("my_diary.txt","r",encoding="utf-8")
print(f.read())
f.close()
-------------------------------------------------------------------------------------------------------------------------------------
with open("files.txt","r+",encoding="utf-8") as f, open("files.txt.bak","w",encoding="utf-8") as f_bak:
    res = f.read()
    f_bak.write(res)
    s=""
    for line in res.split('\n'):
         if line.find("测试") == -1:
            s += line +'\n'
    f.seek(0)
    f.truncate()
    f.write(s)
---------------------------------------------------------------------------------------------------------------------------------------

with open("my_diary.txt","r",encoding="utf-8")as f:
    com = f.read()
    co = com.count("python")
    print(co)
-----------------------------------------------------------------------------------------------------------------------------------------
# import my_module_math as math

# math.add(3,5)
# print(math.PI)


# 单一功能导入
# from my_module_math import add
# add(3,5)
# sub(3,5)


# 无前缀导入
from my_module_math import add as my_add

def add(a,b,c):
    print(a+b+c)

my_add(3,5)
add(3,5,10)
----------------------------------------------------------------------------------------------------------------------------------------
 导入模块
import random as r
import secrets 


# 生成0-1之间的浮点数
# print(r.random())

# 生成1-10之间的随机整数
# for i in range(20):
#     print(r.randint(1,10))

# # 随机输出列表元素
# # 随机取一个
my_list = [1,321,643,765,32,65,2,419,98,9,1001]
# for i in range(10):
#     print(r.choice(my_list))


# # 随机取多个放入新列表
# print(r.sample(my_list,5))

# # 生成一个安全的随机整数
for i in range(20):
    print(secrets.randbelow(100))
------------------------------------------------------------------------------------------------------------------------------------
'''